home *** CD-ROM | disk | FTP | other *** search
- Path: news.microsoft.com!news
- From: a-cnadc@microsoft.com (Dann Corbit)
- Newsgroups: comp.lang.c
- Subject: Re: HELP!! Urgent Borland 4.5 problem
- Date: 7 Feb 1996 22:11:10 GMT
- Organization: Microsoft Corporation
- Message-ID: <4fb81u$91a@news.microsoft.com>
- References: <311759F5.41C67EA6@ap.co.umist.ac.uk>
- NNTP-Posting-Host: 157.57.171.202
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.93.14
-
- In article <311759F5.41C67EA6@ap.co.umist.ac.uk>, =-dan-= says...
- >
- >I've got a majour problem which I can't find the
- >answer to ANYWHERE!!
- >
- >How do you (in v4.5) have one source code which
- >uses functions you wrote yourself but must be
- >stored in a different file.
- You may have already explored this, but did you include
- the prototypes for the functions stored in a different
- file into the file that uses them using an include file?
-
- e.g.
-
- file1.c :
- ---------
- #include "myfuncs.h"
- int f1( int iVal )
- {
- return iVal--;
- }
- int f2( int iVal )
- {
- return iVal++;
- }
-
- file2.c :
- ---------
- #include <stdio.h>
- #include "myfuncs.h"
- int main()
- {
- int iVal;
- iVal = 2;
- iVal = f1( iVal );
- printf( "iVal after f1:%d\n", iVal );
- iVal = f1( iVal );
- printf( "iVal after f2:%d\n", iVal );
- }
-
- myfuncs.h :
- -----------
- int f1( int iVal );
- int f2( int iVal );
-
- --
- The opinions expressed in this message are my own personal views
- and do not reflect the official views of Microsoft Corporation.
-
-